<template>
  <div>
    {{ workdata }}
    <p v-for="i in workdata" :key="i">
      <van-field v-if="i.type == 'input'" :label="i.lable" />
      <select v-if="i.type == 'select'">
        <option :value="j.type" v-for="j in i.values" :key="j">
          {{ j.name }}
        </option>
      </select>
      <van-uploader v-if="i.type == 'file'" />

      <el-date-picker
        v-if="i.type == 'datetime'"
        type="date"
        placeholder="选择日期"
      >
      </el-date-picker>
    </p>
  </div>
</template>

<script>
import axios from "../../http/axios";
export default {
  data() {
    return {
      workid: this.$route.query.id,
      workdata: [],
      values:{}
      
    };
  },
  methods: {
    getdata() {
      axios("/work?workid=" + this.workid, "get").then((res) => {
        this.workdata = JSON.parse(res.list.params);
        console.log(JSON.parse(res.list.params));
      });
    },
  },
  mounted() {
    this.getdata();
  },
};
</script>

<style>
</style>